package com.kstech.exccheck.fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;

import com.kstech.exccheck.R;
import com.kstech.exccheck.domain.check.CheckItemDetailEntity;
import com.kstech.exccheck.domain.check.CheckItemDetailStatusEnum;
import com.kstech.exccheck.domain.check.CheckItemParamValueVO;
import com.kstech.exccheck.util.AppContext;
import com.kstech.exccheck.view.upload.Globals;

/**
 * Created by lijie on 2016/12/10.
 */

public class DataListFragMent extends Fragment {
    private ListView DLFragMentListView;
    public MyDLFragMentListViewAdapter mfmlvAdapter;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_list_data,null);
        DLFragMentListView = (ListView) view.findViewById(R.id.lv_fg_data);
        mfmlvAdapter = new MyDLFragMentListViewAdapter();
        DLFragMentListView.setAdapter(mfmlvAdapter);
        return view;
    }
    public void update(){
        mfmlvAdapter.notifyDataSetChanged();
    }
    class MyDLFragMentListViewAdapter extends BaseAdapter{
        @Override
        public int getCount() {
            return Globals.content.size();
        }

        @Override
        public Object getItem(int i) {
            return Globals.content.get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            ItemDataView idv = new ItemDataView(getActivity(),Globals.content.get(i));
            return idv;
        }
    }
}
